import React, { Component } from 'react';
import { Select, Input, Button, Modal } from 'antd';
const Option = Select.Option;

class ExamineModal extends Component {
  constructor(props) {
    super(props);
    this.state = {
      id: '',
      data: [],
      adopt: ''
    };
  }
  componentWillReceiveProps(nextProps) {
    if (nextProps.obj == 'adopt') {
      this.state.adopt = true;
    } else {
      this.state.adopt = false;
    }
    if (this.state.id == nextProps.ID) {
      return false;
    } else {
      this.state.id = nextProps.ID;
      this.state.realname = nextProps.realname;
    }
    console.log(nextProps);
  }


  render() {
    const { ExamineVisible, onCancel, onCreate } = this.props;
    return (
      <Modal
        visible={ExamineVisible}
        title="查看"
        okText="确定"
        cancelText="取消"
        onCancel={onCancel}
        onOk={onCreate}
        destroyOnClose={true}
      >
        {/* {
          this.state.adopt ?
            <div>
              您是否通过 {this.state.realname} 的申请
            </div> : <div>
              您是否拒绝 {this.state.realname} 的申请
            </div>
        } */}
        {this.state.adopt ? <div>
          您是否通过 {this.state.realname} 的申请
        </div> : <div>
          您是否拒绝 {this.state.realname} 的申请
          </div>}
        {/* <div>
          您是否通过 {this.state.realname} 的申请
        </div> */}
      </Modal>
    );
  }

}

export default ExamineModal;